package br.com.winesys.geta.editor;

import java.awt.Component;
import javax.swing.JComponent;
import br.com.winesys.geta.databinding.Field;

public class CustomObjectEditor<T> extends AbstractObjectEditor<T> {

    public CustomObjectEditor(JComponent component) {
        super(component);
    }

    @Override
    protected void createFields() {
        for (Component comp : this.getComponent().getComponents()) {
            if (comp instanceof JComponent) {
                String name = comp.getName();
                if (name != null && !name.isEmpty()) {
                    this.addField(new Field(name, null, (JComponent) comp));
                }
            }
        }
    }
}
